<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_details', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('goods_id')->notNull()->default(0)->comment('商品id');
            $table->string('sku')->notNull()->default('')->comment('商品sku集合');
            $table->decimal('price')->notNull()->default(0.01)->comment('商品价格');
            $table->string('picture_id')->notNull()->default('')->comment('商品图片集合');
            $table->integer('inventory')->notNull()->default(0)->comment('库存');
            $table->string('remarks')->notNull()->default('')->comment('备注');

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_details');
    }
}
